#!/bin/sh
. ./conf/env.sh

cd /ns7

cd rc; cp -r . ../pungi/installer/5.0/mips64el/os/; cd ..
cp conf/iso-ks.cfg ./pungi/installer/5.0/mips64el/os/ks.cfg
chmod -x ./pungi/installer/5.0/mips64el/os/Packages/*.rpm
chmod 644 ./pungi/installer/5.0/mips64el/os/boot/initrd.img


cd pungi/installer/5.0/mips64el/os/
rm -rf manual; mkdir manual
cd manual

rpm2cpio ../Packages/System_Administration-Adv-*.rpm | cpio -id
mv ./usr/share/doc/NeoKylin_Manual-Adv/NLAS_V5.0_System_Administration.pdf \
    "中标麒麟军用服务器操作系统（龙芯版）V${product_version}-系统管理员手册.pdf"
rm -rf ./usr

rpm2cpio ../Packages/System_Installation-Adv-*.rpm | cpio -id
mv ./usr/share/doc/NeoKylin_Manual-Adv/NLAS_V5.0_System_Installation.pdf \
    "中标麒麟军用服务器操作系统V${product_version}（龙芯64位）-安装手册.pdf"
rm -rf ./usr

rpm2cpio ../Packages/System_Release_Note-Adv-*.rpm | cpio -id
mv ./usr/share/doc/NeoKylin_Manual-Adv/NLAS_V5.0_System_Release_Note.pdf \
    "中标麒麟军用服务器操作系统软件（龙芯版）V${product_version_id}-B${product_build_id}版本说明.pdf"
rm -rf ./usr
rm -rf ./etc

cd /ns7

echo "$PRODUCTINFO_ISO" > ./pungi/installer/5.0/mips64el/os/.productinfo
